package cn.duli.myvideo.service.Impl;

import cn.duli.myvideo.mapper.CollectMovieMapper;
import cn.duli.myvideo.pojo.CollectMovie;
import cn.duli.myvideo.service.CollectMovieService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CollectMovieServiceImpl implements CollectMovieService {

    @Resource
    private CollectMovieMapper collectMovieMapper;

    @Override
    public Page<CollectMovie> findAll() {
        return collectMovieMapper.findAll();
    }

    @Override
    public Integer findCountByMovieId(Integer mId) {
        return collectMovieMapper.findCountByMovieId(mId);
    }

    @Override
    public List<CollectMovie> findByUserId(Integer uId) {
        return collectMovieMapper.findByUserId(uId);
    }

    @Override
    public List<CollectMovie> findByMovieId(Integer mId) {
        return collectMovieMapper.findByMovieId(mId);
    }

    @Override
    public void save(CollectMovie collectMovie) {
        collectMovieMapper.save(collectMovie);
    }

    @Override
    public void deleteById(Integer cmId) {
        collectMovieMapper.deleteById(cmId);
    }
}
